﻿using System;
using System.Collections.Generic;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Text;

namespace ExpertMIS.UserControl
{
    public partial class ucFlashRock : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected string OutputRockValues()
        {
            StringBuilder sb = new StringBuilder();

            RockItems items = new RockItems();

            StringBuilder sbFiles = new StringBuilder("bcastr_file=");            
            int i = 0;
            foreach(RockItem item in items)
            {
                if( i ++ > 0) sb.Append("|");
                sb.Append(item.Image);
            }

            StringBuilder sbLinks = new StringBuilder("bcastr_link=");            
            i = 0;
            foreach(RockItem item in items)
            {
                if( i ++ > 0) sb.Append("|");
                sb.Append(item.URL);
            }

            StringBuilder sbTitle = new StringBuilder("bcastr_title=");            
            i = 0;
            foreach(RockItem item in items)
            {
                if( i ++ > 0) sb.Append("|");
                sb.Append(item.Title);
            }

            sb.Append(string.Format("{0}&{1}&{2}&TitleBgColor=6699FF",sbFiles, sbLinks,sbTitle));

            return sb.ToString();
        }
    }
}